libxl: suspend: Async libxl__domain_suspend_callback
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 4 Nov 2013 16:27:53 +0000 (16:27 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 17 Mar 2014 15:53:59 +0000 (15:53 +0000)
commitb837b0daec4f8a91064d31fbcf55f382f75d361d
tree4064845a1dfb0044a4650b3601b706430a05b909
parentd9cf3b4cc02e4ac635f7ec4480456420960bbb9a
libxl: suspend: Async libxl__domain_suspend_callback

Mark the suspend callback libxl__domain_suspend_callback as
asynchronous in the helper stub generator (libxl_save_msgs_gen.pl).
We are going to want to provide an asynchronous version of this
function to get rid of the usleeps and waiting loops in the suspend
code.

libxl__domain_suspend_common_callback, the common synchronous core,
which used to be provided directly as the callback function for the
helper machinery, becomes libxl__domain_suspend_callback_common.  It
can now take a typesafe parameter.

For now, provide two very similar asynchronous wrappers for it
(normal, and remus).  Each is a simple function which contains only
boilerplate, calls the common synchronous core, and returns the
asynchronous response.

Essentially, we have just moved (in the case of suspend callbacks) the
call site of libxl__srm_callout_sendreply.  It was in the switch
statement in the autogenerated _libxl_save_msgs_callout.c, and is now
in the handwritten libxl_dom.c.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v3: Clarify commit message.
    Fix a misformatted CC in the commit message
    Do not introduce a whitespace error in libxl_save_msgs_gen.pl
v2: Commit message mentions usleeps, not Remus, as motivation.
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_save_msgs_gen.pl